import numpy as np 
import cv2 as cv 
import sys
 
img = cv.imread('./img/2.jpg',cv.IMREAD_COLOR)

if img is None:
    sys.exit('img no find')
img_gray=cv.cvtColor(img,cv.COLOR_BGR2GRAY)

cv.imwrite('2_gray.jpg',img_gray,[cv.IMWRITE_JPEG_QUALITY,100])

cv.imshow('2_gray',img_gray)
cv.imshow('2_jpg',img)

cv.waitKey(0)
cv.destroyALLWindows()
